All Functions Used So Far, Week 2

ordered

{dplyr}

Create an ordered factor

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

plot

{graphics}

Generic function from base R to produce a plot

cut

{base}

Convert Numeric to Factor

lprop

{questionr}

Display row percentages of a two-way frequency table

sd

{stats}

Get standard deviation of a vector

names

{base}

Retrieve names of a list/vector

cbind

{base}

Combine R objects by columns

range

{base}

Return range of values

rbind

{base}

Combine R objects by rows

select

{dplyr}

Select columns from a tibble/data frame

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

min

{base}

Get minimum of a vector

boxplot

{graphics}

Plot a simple box plot

geom_histogram

{GGPLOT2}

Generates a histogram

freq

{questionr}

Generate frequency tables

ncol

{base}

Get number of columns of a data frame

rm

{base}

Remove objects

arrange

{dplyr}

Sort values of data frame according to a variable/combination of varaibles

nrow

{base}

Get number of rows of a data frame

seq

{base}

Create a sequence

is.na

{base}

Check if a value is NA/elements of vector are NA

pie

{graphics}

Creates a basic pie chart

class

{base}

Retrieve class of an R object

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

mutate

{dplyr}

Modify/create a column in a data frame

setwd

{base}

Set Working Directory

attach

{base}

Attach Set of R Objects to Search Path

sum

{base}

Get sum of numeric values or a vector

dim

{base}

Get dimensions of a data frame

labs

{GGPLOT2}

Customise labels in GGPLOT2

max

{base}

Get maximum of a vector

slice

{dplyr}

Subset rows using their positions

summary

{base}

Obtain summary statistics or detailed regression output

recode

{dplyr}

Recode a variable

filter

{dplyr}

Filter out rows of a data frame according to logical vector

hist

{graphics}

Plot a simple histogram

str

{utils}

Get the structure of an R object

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

factor

{base}

Create a factor

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

ungroup

{dplyr}

Resolve grouping created with “group_by”

geom_bar

{GGPLOT2}

Generates a bar chart

read_excel

{readxl}

Read an Excel file

ls.str

{utils}

Similarly to ls, with a print() method that calls str() on each object

install.packages

{base}

Install R package

desc

{dplyr}

Arrange in descending order

ggtitle

{GGPLOT2}

Generates a title for a ggplot graph

View

{base}

View a data frame

levels

{base}

Get levels of a factor

ifelse

{base}

Return a or b depending on the value of test

library

{base}

Load an R package

c

{base}

Combine values/vectors into a vector

median

{stats}

Get median of a vector

head

{utils}

Show first 5 rows of a data frame

var

{stats}

Calculate variance

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

ggplot

{GGPLOT2}

Create a ggplot graph

read.spss

{foreign}

Read a .sav file (SPSS data)

mean

{base}

Get mean of a vector

The end!